<template>
  <div class="live-status-box" :class="LIVE_STATUS_BG_MAP[liveStatus]">
    <div class="living-icon" v-if="liveStatus == 1">
      <span class="pillar"></span>
      <span class="pillar"></span>
      <span class="pillar"></span>
    </div>
    <span>{{ LIVE_STATUS_MAP[liveStatus] }}</span>
  </div>
</template>
<script>
const LIVE_STATUS_MAP = {
  0: '未开始',
  1: '直播中',
  2: '已结束',
  3: '已结束'
};
const LIVE_STATUS_BG_MAP = {
  0: 'c-translucent-balck50',
  1: 'c-bg-mgreen',
  2: 'c-translucent-balck50',
  3: 'c-translucent-balck50'
};
export default {
  props: {
    liveStatus: {
      type: Number,
      default: 2
    }
  },
  components: {},
  data() {
    return {
      LIVE_STATUS_MAP: LIVE_STATUS_MAP,
      LIVE_STATUS_BG_MAP: LIVE_STATUS_BG_MAP
    };
  }
};
</script>
<style scoped>
.live-status-box {
  height: 20px;
  border-radius: 2px;
  padding: 0 6px;
  display: flex;
  justify-content: center;
  align-items: center;
  color: #fff;
  font-size: 12px;
}
.living-icon {
  display: flex;
  align-items: flex-end;
}
.living-icon span {
  width: 2px;
  margin: 0 2px;
  height: 12px;
  background: #fff;
  border-radius: 4px;
  animation: pillarDance 2s infinite ease;
}
.living-icon span:first-child {
  animation-delay: 0.5s;
}
.living-icon spanr:nth-child(2) {
  animation-delay: 1s;
}
.living-icon span:nth-child(3) {
  animation-delay: 1.5s;
}
@keyframes pillarDance {
  0% {
    height: 4px;
  }
  50% {
    height: 12px;
  }
  100% {
    height: 4px;
  }
}
</style>
